package ShuZu;

public class Demo02 {
    public static void main(String[] args) {
//        练习题：{11,30,23,22,50,33,45,48} 找出既能被2整除，或能被5整除的数

        int[] arrs = {11, 30, 23, 22, 50, 33, 45, 48};
        int target = arrs[0];

        for (int i = 0; i < arrs.length; i++) {
            if (arrs[i] % 2 == 0 || arrs[i] % 5 == 0) {
                target = arrs[i];
                System.out.println("target=" + target);
            }
        }

//        增强型for循环
        for (int nums : arrs) {
            if (nums % 2 == 0 || nums % 5 == 0) {
                target = nums;
                System.out.println("target=" + target);
            }
        }

    }
}
